UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pu81MF1f3OPBXIFTV/0/Zchfyjc6VQv3zMZnpcAI4hs='
WHERE
key_id = 'e05ca1fe46d398a32b3cc634e3273054914219b140a1a7bc003a503c60a42e62'
AND (
token = 'pu81MF1f3OPBXIFTV/0/Zchfyjc6VQv3zMZnpcAI4hs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)