UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OYogDm4luyYHcbvYTwQLBwHV82vAI9FsUh9dDIjqfbs='
WHERE
key_id = '91d5fb33a98f561b48755dc208430f0f67cc7a0b966df211b86595f49a2697ab'
AND (
token = 'OYogDm4luyYHcbvYTwQLBwHV82vAI9FsUh9dDIjqfbs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)