UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '69bhA426472A87vY+xgBJmJGk3NfTtNNwFbqeOCYx7s=' 
WHERE 
  key_id = 'a693686e1e924bb7ca7bdce29c9bb05096cf9ac4bf1d345d84a9b7d8e040e3d5' 
  AND (
    token = '69bhA426472A87vY+xgBJmJGk3NfTtNNwFbqeOCYx7s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027