UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AI6Ja0H4GpPpzHRTUPP3BKoZetYpLdr7+ca8L2zHm/c='
WHERE
key_id = '9e7e6927799347dba6c33de62677f044e6c9f2b138ba5424fb5db74cfb8b1859'
AND (
token = 'AI6Ja0H4GpPpzHRTUPP3BKoZetYpLdr7+ca8L2zHm/c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)