UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MOKfjT8VWTzItmlGVVX6xQBBoeHMEnInGZPdfVwUrfY=' 
WHERE 
  key_id = '195760ad465b73bf05f58bea00024ec7833762a71c2b3ff6e6938e4c7ddb736b' 
  AND (
    token = 'MOKfjT8VWTzItmlGVVX6xQBBoeHMEnInGZPdfVwUrfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042