UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H4DcfwxsvAtygXWh03x1UwG3MNpuYxr0ZK2SGLrjeXU=' 
WHERE 
  key_id = '92c18d0ed97d2414f808389ea2e0f0489b2f5198c49857033712d07fea2e39b3' 
  AND (
    token = 'H4DcfwxsvAtygXWh03x1UwG3MNpuYxr0ZK2SGLrjeXU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033