UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LZSXIW9AUyOqp3UT7SKHOtlwXUZV9ty7aKbwT01qHsQ='
WHERE
key_id = 'a4214e03e5fb3a88d3d1f20295c3a7123a1be9e3f6eaeeb63a56de9bf64e89f8'
AND (
token = 'LZSXIW9AUyOqp3UT7SKHOtlwXUZV9ty7aKbwT01qHsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)