UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eLgSeTi33Q/pM3VQabJPn8XPv0Us6YSKpvQ5Cag9D0s='
WHERE
key_id = 'cc3c3bc6db1cd457d293476eedce1351aec5c01005c90487e39c3ec895a17f39'
AND (
token = 'eLgSeTi33Q/pM3VQabJPn8XPv0Us6YSKpvQ5Cag9D0s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)