UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mtuJBgDjQ6QeeE0UNnZ/6WFL9kbU8L7/rpdo1Ojdd+Q='
WHERE
key_id = '142c015ac9c0bcf750eab125d88e8daec5b8348da00d81971fa9098303c5a7e5'
AND (
token = 'mtuJBgDjQ6QeeE0UNnZ/6WFL9kbU8L7/rpdo1Ojdd+Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)