UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yDzSiTuSCe5gd/UcGy5E47oFfhy0DpzV0u1KbLU1GSw=' 
WHERE 
  key_id = '098f21fa0759dcb37ed273bee16170ff3d3190a620f20f7d65160d5b18e553d2' 
  AND (
    token = 'yDzSiTuSCe5gd/UcGy5E47oFfhy0DpzV0u1KbLU1GSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033