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