UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1B9xn3FDGs/DhUYmy2b37dhIB/KNeomXecQJI1oXyZg=' 
WHERE 
  key_id = '2a0aca3ada91a965fafcd00a49c8f25da67b6b2c85c1f3fb3c6be81a0a2be1cb' 
  AND (
    token = '1B9xn3FDGs/DhUYmy2b37dhIB/KNeomXecQJI1oXyZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046