UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nJpGt1h6cVhu54KyBj0m6w01q28Crk/o9dKOA8hOc3c='
WHERE
key_id = 'fb56ec64cd2533ef77993c436dabeac63e5609373d56434b8b1acf51b42beae6'
AND (
token = 'nJpGt1h6cVhu54KyBj0m6w01q28Crk/o9dKOA8hOc3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)