UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nK5xyo4YBPw9/JSdQZJ9IWFvZvBliWuTo1en1oO2dAo='
WHERE
key_id = '50055ef837146cba11e089fab3cf183b39eeb0821f67bce2e09f0b593f950a5b'
AND (
token = 'nK5xyo4YBPw9/JSdQZJ9IWFvZvBliWuTo1en1oO2dAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)