UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YNZSyL21KNK/VcUUlcxHHdFBEdMfRgE2fkxHpLwDdP8='
WHERE
key_id = '196bcb9f24f10eeef1c44010f24c26155c5ce60c7288e68d80c384cdcc053cce'
AND (
token = 'YNZSyL21KNK/VcUUlcxHHdFBEdMfRgE2fkxHpLwDdP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)