UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l27Iq1j4mmuvQfkkImNuqIZYoGutOqv4Xshsld0m8Hk='
WHERE
key_id = '2ecc41c7fd4d04465c313ca7441b4c03ae0e10e3cb813eca14042a972dbfefa9'
AND (
token = 'l27Iq1j4mmuvQfkkImNuqIZYoGutOqv4Xshsld0m8Hk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)