UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jnUr53rOshXkHpk3RomgUImIZoGG9BiepVSA8ncXc3U=' 
WHERE 
  key_id = '3925dade724184a2045964eb9739446e88bead555d6cc1e50929227a4a41a072' 
  AND (
    token = 'jnUr53rOshXkHpk3RomgUImIZoGG9BiepVSA8ncXc3U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027