UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UEv7APwUvLVoEUEcZyCd9LMvEPhyd76Jgzvvzqse4Ak=' 
WHERE 
  key_id = 'd724b8ab2da55a5b39775df46a10db7c3e202d2945c6e4f069c7a8396e850163' 
  AND (
    token = 'UEv7APwUvLVoEUEcZyCd9LMvEPhyd76Jgzvvzqse4Ak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025