UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XQEl4QQ4tc0K5KIlrxu7jjsgHhd8z6RePJJlsqwp10='
WHERE
key_id = '36fc64ca3af025b5a86df9ca009fcc5d41a7682af2bb4a309ccde7e8eed9bc22'
AND (
token = '4XQEl4QQ4tc0K5KIlrxu7jjsgHhd8z6RePJJlsqwp10='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)