UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6TcnNC6XjIAmQmUyPmuoRSBU+N6PiuWdv8A5MCjR9Ok='
WHERE
key_id = '1df4d24c3736d75d90d0ca0610cc00fced81dc48771e16eb868b62730e94d868'
AND (
token = '6TcnNC6XjIAmQmUyPmuoRSBU+N6PiuWdv8A5MCjR9Ok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)