UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xYO1cgoioFReHhKaaLTobn6UJyyuBmotvWYp29ErhFs=' 
WHERE 
  key_id = '6433d06cc21a2a9db9ddbda7ae21ea6effc11a99ff17da1a9ad3252776413a23' 
  AND (
    token = 'xYO1cgoioFReHhKaaLTobn6UJyyuBmotvWYp29ErhFs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028