UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sFpj7Rcd06X5rBkP7DjJGuzMsZ+Tcia5cB9LZs2BdyA='
WHERE
key_id = '99f194d759f5cd269cc41dcde6f8e990986a887c940d7a90b65d273f6a2f8a86'
AND (
token = 'sFpj7Rcd06X5rBkP7DjJGuzMsZ+Tcia5cB9LZs2BdyA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)