UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vKhe4pswYEZ8cQaCneOm3UL4jE+xSXkbPh9bi9+7P+I='
WHERE
key_id = 'a61acbe9b5d0ee7efd1b4d5bbbaa8a2cca1cf89b6052ffdb1e3876456250bc10'
AND (
token = 'vKhe4pswYEZ8cQaCneOm3UL4jE+xSXkbPh9bi9+7P+I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)