UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4dlYLVzXgZTW19ujDj2gqAAlzH2xwsOHTbH8mRnsBXQ=' 
WHERE 
  key_id = 'e6baef9baeb1e0e22484645ce00141185a876c1f396eee1d5f4fe59b883f7e2f' 
  AND (
    token = '4dlYLVzXgZTW19ujDj2gqAAlzH2xwsOHTbH8mRnsBXQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032