UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8T8IXwZyFNqHRH70C01y4VKmZS3X9VEAGVi6YoxSsoU='
WHERE
key_id = '79ec5802d513084363ea85cb8696e22c6c90c8b950503a8000d0fb3d5426c68e'
AND (
token = '8T8IXwZyFNqHRH70C01y4VKmZS3X9VEAGVi6YoxSsoU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)