UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9xWR/BKX9j8ONeUwl9jlUV6JGQG5ieIun/TmPSYZkJU='
WHERE
key_id = '79dfea927dab15c1813b3dbbc60e80f126bfc427ef3f7a8c3f6e88786883ebac'
AND (
token = '9xWR/BKX9j8ONeUwl9jlUV6JGQG5ieIun/TmPSYZkJU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)