UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7aDJyozUrZ5/WRljwLBiDNI+9a6WR50Opgw6PJYmYLw=' 
WHERE 
  key_id = '09ae9bebc4c4d5abb7861722ecd09976db5dc1727016cb394e831b51e2e364c3' 
  AND (
    token = '7aDJyozUrZ5/WRljwLBiDNI+9a6WR50Opgw6PJYmYLw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035