UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rfiQoVQAURR7Dzb6nqIdY6pSGuWiUDJUmj05/OVFxzU=' 
WHERE 
  key_id = '3b6c3f6c0f75c983580f088f0d2793187b650b9e8a485ff9127d3d8cb502fabd' 
  AND (
    token = 'rfiQoVQAURR7Dzb6nqIdY6pSGuWiUDJUmj05/OVFxzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044