UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qta+sdqNoJeqpkihrW3D44EX6Bg021Qt6RQLJFmbxNQ='
WHERE
key_id = '05aa799c19f60ebcd0ed745bb6822333508ced366b3ecad7c0f8e0285ab51f87'
AND (
token = 'Qta+sdqNoJeqpkihrW3D44EX6Bg021Qt6RQLJFmbxNQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)