UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8EuNFAAYh3A9RE//NTgDZw64gsxoSuMct3yc2ZW4Hvk=' 
WHERE 
  key_id = '380605e9c94e79068ddd9fcaaa311e912295b50ac2d2d1bebd75317c448192b8' 
  AND (
    token = '8EuNFAAYh3A9RE//NTgDZw64gsxoSuMct3yc2ZW4Hvk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032