UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UVzP2pymtysSzmHqiaVmsSXj6PM81T8lNtooQJE/Lvg=' 
WHERE 
  key_id = '05b1014208b3779944af4882bb1d47b95540819be6f60cb302eac28ee2a10cee' 
  AND (
    token = 'UVzP2pymtysSzmHqiaVmsSXj6PM81T8lNtooQJE/Lvg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025