UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w/oM8EenZ80G27mp2qaYz0V2y9kVEvOHhUvhwvGxaCg=' 
WHERE 
  key_id = '9ad2f97f860f7ec1940ea17a7e517cb427be17e4fb3681cae4b756f0c3b1b098' 
  AND (
    token = 'w/oM8EenZ80G27mp2qaYz0V2y9kVEvOHhUvhwvGxaCg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034