UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N++EjQ3y7Gc0T6pHVDTQ1cKHxz01HHvDmSwNHk6Wnpk=' 
WHERE 
  key_id = '664dd322206776bb81e41eb8a36389cf3e32f8a28e0ee9b2369f68cb4b8e7dc3' 
  AND (
    token = 'N++EjQ3y7Gc0T6pHVDTQ1cKHxz01HHvDmSwNHk6Wnpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015