UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X+oisB//dkEIoxnOk3hBWxYLWvm0y5FlTPl50XtCjGo='
WHERE
key_id = '9b337af8a66a116a66c0d23dee23bf5603dc8a0ef0dae2f0ffc9f54c8fe5025b'
AND (
token = 'X+oisB//dkEIoxnOk3hBWxYLWvm0y5FlTPl50XtCjGo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)