UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7/vufvyBU72AcEnHpMNNVsUNPM99YtLx/v/Rp3KQjRw=' 
WHERE 
  key_id = 'c8dd4176c90f89158943fa2888148351ab53aecc59af0318b3e4bfa0e4dbbec0' 
  AND (
    token = '7/vufvyBU72AcEnHpMNNVsUNPM99YtLx/v/Rp3KQjRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035