UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/fhhOdMbyqEmgdETKeB4oMmdNlsPAO5tsIes0NcrT1k='
WHERE
key_id = '5eee35ac1de5c0d9b35aed419bca6fbf268650faf17d1b22df3cadfea0413a60'
AND (
token = '/fhhOdMbyqEmgdETKeB4oMmdNlsPAO5tsIes0NcrT1k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)