UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YiAXn0UfijuTaRhoYZ4dueQLn+i/4ebHl9dKVJE8Lmc=' 
WHERE 
  key_id = '6dcfc98bdd38ca5eff2071f37f84ff9e53e33eff917bfea62baaaa72066f7e33' 
  AND (
    token = 'YiAXn0UfijuTaRhoYZ4dueQLn+i/4ebHl9dKVJE8Lmc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038