UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tabD6D4swLSbeWuWqQruJ2jZPHaIK8d8AQ2eqmrq4Nc=' 
WHERE 
  key_id = 'cd3a0caf27394c4b846e2fbec731e1ebd0c24b098d3a0385712f92a0dcdd8de4' 
  AND (
    token = 'tabD6D4swLSbeWuWqQruJ2jZPHaIK8d8AQ2eqmrq4Nc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035