UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JaWCMjrgS8/KNylnlWaelZbkmURvt2NbhH8HnTBq85Q='
WHERE
key_id = '032660425cd957f92af62cd09697c5cd76e4f184e33a7e470655c4649b3c1684'
AND (
token = 'JaWCMjrgS8/KNylnlWaelZbkmURvt2NbhH8HnTBq85Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)