UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g2DUrISPF01HgjDA3h9xaSII3Vk1/5VIfnuhXt7CVrM=' 
WHERE 
  key_id = 'b8a863aa41da9d1a26fe174c278c9350695587b3b3302ad89027127bc72b9f53' 
  AND (
    token = 'g2DUrISPF01HgjDA3h9xaSII3Vk1/5VIfnuhXt7CVrM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044