UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MKm+C0DcGmma1kPDZJwxZNTS59/HoABNUzW6e+XD8x0=' 
WHERE 
  key_id = '04722ff89684a3d814b36f8c642b0d193d796a3cbcfab939bb11d97b290bac69' 
  AND (
    token = 'MKm+C0DcGmma1kPDZJwxZNTS59/HoABNUzW6e+XD8x0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051