UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm5/Pa/cJlUvPpy3FqbFt2cjWyOcOq/SJJpHI2KE19+M='
WHERE
key_id = '9389d98849d0d8d49eb0bf504ed23e1755cf2844eedd1657bc499169fbc2fdf0'
AND (
token = 'm5/Pa/cJlUvPpy3FqbFt2cjWyOcOq/SJJpHI2KE19+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)