UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'aev2iJpfzXwCZ778Jn3TX01JwH1qNryF//tH7/CPB3w=' 
WHERE 
  key_id = '1c3b511b53113d4183ba08b52b23c5438fffdf11b9aa1035acf7eb3594b50bfc' 
  AND (
    token = 'aev2iJpfzXwCZ778Jn3TX01JwH1qNryF//tH7/CPB3w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032